<template>
  <div class="kanjia">
    <van-card
      v-for="item in shoppinglist"
      :key="item.id"
      :price="item.price"
      :title="item.storeName"
      :thumb="item.image"
    >
      <template #desc>
        <div>
          <p class="old">{{item.otPrice}}</p>
        </div>
      </template>
    </van-card>
  </div>
</template>
<script>
export default {
  props: ["shangplist"],
  data() {
    return {
      shoppinglist:[]
    };
  },
  methods: {
    async kanjiadata() {
      const res = await this.$http.getkanjia();
      console.log(res.data.data.productList);
      this.shoppinglist=res.data.data.productList
    },
  },
  created() {
    this.kanjiadata();
  },
  watch: {
    getshangp(newval, oldval) {
      if (newval) {
        this.shangplist = newval;
        console.log(this.shangplist);
      }
    },
  },
};
</script>
<style lang="scss" scoped>
.kanjia {
  width: 90%;
  margin: 0 auto;
  .van-card{
    border-radius: 15px;
  }
  .van-card__header {
    
    .van-card__thumb {
      .van-image {
        img {
          width: 100%;
          height: 100%;
        }
      }
    }
  }
  .van-card__content {
    .van-card__bottom {
      .van-card__price {
        div {
          color: red;

          .van-card__price-integer {
            font-size: 18px;
          }
        }
      }
    }
  }
}
</style>